﻿using HoverTree.BLL;
using HoverTree.Model;
using System;
using System.Web.Security;

namespace HoverTreeMobile.HvtAdmin
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            HvtPanelUser m_user = new HvtPanelUser();
            PanelUserInfo m_info = new PanelUserInfo();
            m_info.Hvtusername = txtUsername.Text;
            m_info.Hvtpassword = txtPassword.Text;
            if (m_user.Login(m_info) == string.Empty)
            {
                FormsAuthentication.SetAuthCookie(m_info.Hvtusername.ToLower(), false);
                Response.Redirect("index.aspx");
                //FormsAuthentication.RedirectFromLoginPage(m_info.Hvtusername.ToLower(), false);
            }
            else
                ltlTips.Text = "用户名或者密码错误!";
        }
    }
}